<?php
abstract class AbstractExtJsChart extends CWidget {
	
	public $width=420;
	public $height=500;
	public $title="Chart";	
	
	public function init()
	{
		$scriptUrl=Yii::app()->assetManager->publish(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets');
		$cs=Yii::app()->getClientScript();
		$cs->registerScriptFile($scriptUrl.'/ext-all.js');
		$cs->registerCssFile($scriptUrl.'/resources/css/ext-all.css');
		parent::init();
	}
	
	protected function registerChartScript($script) {
		$cs=Yii::app()->getClientScript();
		$cs->registerScript('chart-'.$this->getId(),$script,CClientScript::POS_END);
	}
	
	public function run(){
		$this->render('chart');
	}
}